package com.ulic.customerManApplication.journeylovemodule.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ulic.customerManApplication.journeylovemodule.bo.JourneyOfLoveActivity;
import com.ulic.customerManApplication.journeylovemodule.dao.JourneyLoveDao;
import com.ulic.customerManApplication.journeylovemodule.service.JourneyLoveService;
import com.ulic.customerManApplication.journeylovemodule.vo.JourneyLoveVO;
import com.ulic.customerManApplication.pager.PagerModel;
import com.ulic.customerManApplication.usermodule.bo.User;

@Component("journeyLoveService")
public class JourneyLoveServiceImpl implements JourneyLoveService {

	private JourneyLoveDao journeyLoveDao;
	
	
	public JourneyLoveDao getJourneyLoveDao() {
		return journeyLoveDao;
	}
    @Resource
	public void setJourneyLoveDao(JourneyLoveDao journeyLoveDao) {
		this.journeyLoveDao = journeyLoveDao;
	}

	@Override
	public void addJourneyLove(JourneyOfLoveActivity journeyOfLoveActivity)
			throws Exception {
		journeyLoveDao.insertJourneyLove(journeyOfLoveActivity);
	}

	@Override
	public void addJourneyLoves(
			List<JourneyOfLoveActivity> journeyOfLoveActivities)
			throws Exception {
		journeyLoveDao.insertJourneyLoves(journeyOfLoveActivities);
	}

	@Override
	public JourneyOfLoveActivity getJourneyLoveById(int id) {
		return journeyLoveDao.getJourneyLoveById(id);
	}

	@Override
	public PagerModel getJourneyLoves(int curPage) {
		return journeyLoveDao.getJourneyLoves(curPage);
	}

	@Override
	public void modifyJourneyLove(JourneyOfLoveActivity journeyOfLoveActivity)
			throws Exception {
		journeyLoveDao.updateJourneyLove(journeyOfLoveActivity);

	}

	@Override
	public void removeJourneyLove(JourneyOfLoveActivity journeyOfLoveActivity) throws Exception {
		journeyLoveDao.deleteJourneyLove(journeyOfLoveActivity);
	}
	@Override
	public JourneyOfLoveActivity getJourneyOfLoveActivityByDate(User user,
			String activityDate) {
		return journeyLoveDao.getJourneyOfLoveActivityByDate(user,activityDate);
	}
	@Override
	public PagerModel getJourneyLoves(
			JourneyLoveVO journeyLoveVO, int curPage) {
		return journeyLoveDao.getJourneyLoves(journeyLoveVO, curPage);
	}
	@Override
	public PagerModel getJourneyLoves(JourneyLoveVO journeyLoveVO, int curPage,
			int pageSize) {
		return journeyLoveDao.getJourneyLoves(journeyLoveVO, curPage, pageSize);
	}

}
